package org.ltc.alliance.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.ltc.alliance.constant.StatusConst;
import org.ltc.alliance.constant.VisibleConst;
import org.ltc.alliance.model.CommentDomain;

import java.util.List;

@Mapper
public interface CommentDao {

    void saveCommentInfo(CommentDomain comment);

    CommentDomain getCommentByMid(Integer cid);
    List<CommentDomain> getCommentListByCid(Integer cid);
    List<CommentDomain> getCommentListByCidAndStatus(@Param("cid") Integer cid,
                                                     @Param("status") StatusConst.Comment status);
    List<CommentDomain> getCommentListByCidAndVisible(@Param("cid") Integer cid,
                                                      @Param("visible") VisibleConst visible);
    List<CommentDomain> getCommentList(@Param("cid") Integer cid,
                                       @Param("status") StatusConst.Comment status,
                                       @Param("visible") VisibleConst visible);

    void alterStatusByMid(@Param("mid") Integer mid, @Param("status") StatusConst.Comment status);
}
